﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EvidenceManagement.Data.Common
{
    public class InvalidDataObjectCommandException : Exception
    {
        public enum DataObjectCommandType
        {
            Read = 0,
            Insert = 1,
            Update = 2,
            Delete = 3,
            List = 4
        };
        readonly DataObjectCommandType commandType;
        readonly object dataObject = null;

        public InvalidDataObjectCommandException()
        {

        }

        public InvalidDataObjectCommandException(string message)
            : base(message)
        {

        }

        public InvalidDataObjectCommandException(DataObjectCommandType commandType, object dataObject)
        {
        }
        public override string Message
        {
            get
            {
                if (dataObject == null)
                    return base.Message;
                else
                {
                    return string.Format("Value of DbObject {0} Command Text for '{1}' is not set."
                        , Enum.GetName(typeof(DataObjectCommandType), commandType).ToUpper()
                        , dataObject.GetType().FullName);
                }
            }
        }
    }
}
